<template>
  <div class="i-form-nodel">
    <!-- {{data}} -->
    <template v-if="Array.isArray(data)">
      <el-row :gutter="20" >
        <el-col :span="i.span" :key="k"  v-for="i,k in data">
          <form-item :data="i" :field="i.field" v-if="!i.hide" />
        </el-col>
      </el-row>
    </template>
    <template v-else>
      <div class="i-form-title" v-if="data.type == 'title'">
          {{data.label}}
      </div>
      <form-item :data="data" :field="data.field" v-if="data.type != 'title' &&!data.hide" />
    </template>
  </div>
</template>
<script type="text/javascript">
import FormItem from './FormItem.vue'

export default {
  components: {
    "form-item": FormItem
  },
  props: {
    value: [Array, Object, String, Number, Boolean, Date],
    data: [Array, Object],
  },
  data() {
    return {

    }
  },
  /**
   * 计算属性
   * @type {Object}
   */
  computed: {

  },
  /**
   * 数据监听
   * @type {Object}
   */
  watch: {

  },
  /**
   * 页面加载执行
   * @return {[type]} [description]
   */
  mounted() {
  },
  /**
   * 页面方法
   * @type {Object}
   */
  methods: {

  }
}

</script>
<style type="text/css" lang="scss">
.i-layout {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  height: calc(100vh - 50px);
  -moz-box-sizing: border-box;
  -o-box-sizing: border-box;
  -ms-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  overflow: hidden;
  background-color: #eeeeee;
}
.i-form-title{
  border-bottom: solid 1px #EBEEF5;
  font-size: 14px;
  line-height: 28px;
  padding: 10px;
  margin-bottom: 30px;
  font-weight: bold;
}
.i-form-nodel .el-form-item__label{
  font-weight: normal;
}
</style>
